//
//  IDTViewController.m
//  Times
//
//  Created by iD Student on 7/11/13.
//  Copyright (c) 2013 iD Student. All rights reserved.
//

#import "IDTViewController.h"

@interface IDTViewController ()

@end

@implementation IDTViewController

- (void)viewDidLoad
{
    [super viewDidLoad];
	// Do any additional setup after loading the view, typically from a nib.
    time = 1;
    timer = [NSTimer scheduledTimerWithTimeInterval:.001 target: self selector: @selector(timerUpdate) userInfo: nil repeats: YES];
}

-(void) timerUpdate
{
    if(milisecondCount > 999)
    {
        milisecondCount = 0;
        secondCount++;
    }
    if(secondCount > 59)
    {
        secondCount = 0;
        minuteCount++;
    }
    if(minuteCount > 59){
        minuteCount = 0;
    }
    timeLabel.text = [NSString stringWithFormat: @"%02d:%02d:%03d", minuteCount, secondCount, milisecondCount];
    milisecondCount++;
}

   
- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

- (void)dealloc {
    [timeLabel release];
    [super dealloc];
}
@end
